﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Combat/Combat.master" AutoEventWireup="true" CodeFile="TaskList.aspx.cs" Inherits="Combat_TaskList" StylesheetTheme="Content" %>

<%@ Register src="../UserContral/ListPageContral.ascx" tagname="ListPageContral" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<ul class="topmenu">
<li>开始：<asp:TextBox ID="txtStartDate" Width="200" runat="server"></asp:TextBox>
                            <ajaxToolkit:CalendarExtender ID="txtStartDate_CalendarExtender" runat="server" 
                                TargetControlID="txtStartDate">
                            </ajaxToolkit:CalendarExtender></li>
<li>
至：
<asp:TextBox ID="txtEndDate" Width="200" runat="server"></asp:TextBox>
                            <ajaxToolkit:CalendarExtender ID="txtEndDate_CalendarExtender" runat="server" 
                                TargetControlID="txtEndDate">
                            </ajaxToolkit:CalendarExtender>
</li>
<li>
    <asp:LinkButton ID="lnbtnQuery" runat="server" onclick="lnbtnQuery_Click">查询</asp:LinkButton></li>
<li>
    <asp:LinkButton ID="lnbtnCreate" runat="server" PostBackUrl="~/Combat/NewExam.aspx">创建新任务</asp:LinkButton></li>
    <li>
        <asp:Label ID="lblPrompt" runat="server" Text="" ForeColor="OrangeRed"></asp:Label>
    </li>
</ul>
<asp:GridView ID="TaskList" runat="server" Caption="<span>已下达任务</span>" 
                    AutoGenerateColumns="False" onrowdatabound="TaskList_RowDataBound">
                    <Columns>
                         <asp:TemplateField HeaderText="序号">
                <ItemStyle HorizontalAlign="Center" />
                <HeaderStyle Width="30px" />
                <ItemTemplate>
                    <asp:Label ID="ID" runat="server" ForeColor="#666666"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
                         <asp:TemplateField HeaderText="任务标题">                           
                             <ItemTemplate>
                                  <a href='NewExam2.aspx?ID=<%# Eval("TaskID") %>&Modify=true'><%# Eval("TaskTitle") %></a>
                             </ItemTemplate>
                             <HeaderStyle HorizontalAlign="Left" />
                         </asp:TemplateField>
                         <asp:TemplateField HeaderText="开始日期">                            
                            <ItemTemplate>
                             <%# DateTime.Parse(Eval("StartDate").ToString()).ToString("yyyy-MM-dd")%>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Left" />
                         </asp:TemplateField>
                         <asp:TemplateField HeaderText="结束日期">                            
                            <ItemTemplate>
                             <%# DateTime.Parse(Eval("EndDate").ToString()).ToString("yyyy-MM-dd")%>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Left" />
                         </asp:TemplateField>                         
                        <asp:TemplateField HeaderText="创建时间">                            
                            <ItemTemplate>
                             <%# DateTime.Parse(Eval("CreateDate").ToString()).ToString("yyyy-MM-dd")%>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Left" />
                         </asp:TemplateField>
                         <asp:TemplateField HeaderText="创建人">                            
                            <ItemTemplate>
                             <%# Yipusoft.Account.BLL.User.GetUser(User.Identity.Name).UserName%>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Left" />
                         </asp:TemplateField>
                         <asp:TemplateField HeaderStyle-Width="10%">
                             <ItemTemplate>
                                 <asp:LinkButton ID="btnModify" CommandArgument='<%# Eval("TaskID") %>' 
                                     runat="server" PostBackUrl=<%# "NewExam.aspx?ID="+Eval("TaskID") %>>修改</asp:LinkButton> <%# bool.Parse(Eval("IsOn").ToString())?"已下达":""%><asp:LinkButton ID="lnbtn" runat="server" ForeColor="Red" Visible='<%#  !bool.Parse(Eval("IsOn").ToString()) %>' CommandArgument='<%# Eval("TaskID") %>' OnClientClick='return confirm("确定要下达任务吗？")' oncommand="lnbtn_Command">下达</asp:LinkButton>
                             </ItemTemplate>
                             <HeaderStyle HorizontalAlign="Center" />
                         </asp:TemplateField>
                    </Columns>
                </asp:GridView>
                <uc1:listpagecontral ID="ListPageContral1" 
        OnPageSizeChange="ListPageContral1_PageSizeChange"  PageSize="10" 
        runat="server" />
</asp:Content>

